﻿using PH5_2004A.Shopping.DAL;
using PH5_2004A.Shopping.IRespository;
using PH5_2004A.Shopping.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PH5_2004A.Shopping.Respository
{
    public class MemberRespository : IMemberRespository
    {

        PH52004ADbContext _context;
        public MemberRespository(PH52004ADbContext context)
        {
            _context = context;
        }

        public List<MemberModel> Query()
        {            
            var list = _context.Members.ToList();
            return list;
        }

        public int Regist(MemberModel modell)
        {
            _context.Members.Add(modell);
            int result = _context.SaveChanges();
            return result;
        }
    }
}
